uniform mat4 u_WVP;
uniform mat4 u_camera_W;

attribute vec3 a_pos_local;
attribute vec2 a_uv;

varying vec2 v_uv;

void main()
{
	//To make the fire always point to camera, exclude the Rotation of Camera so multiply it with Rcam
	//Here we set the pos as vector (pos.w = 0.0) so the translation Tcam is not counted.
	vec4 pos = vec4(a_pos_local, 0.0);
	pos = u_camera_W * pos;
	
	//multi with WVP, the Rotation factor of V is exclude because we multiplied pos with Rcam before.
	pos.w = 1.0;
	pos = u_WVP * pos;
	
	v_uv = a_uv;
	gl_Position = pos;
}